package com.catsic.mod.service;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.catsic.base.BaseService;
import com.catsic.mod.condition.ReceiveMessageCondition;
import com.catsic.mod.entity.ReceiveMessage;
import com.catsic.mod.form.ReceiveMessageForm;

/**
 * 站内信息收件 service接口
 */
public interface ReceiveMessageService extends BaseService<ReceiveMessage,String>{
	/**
	 * findAll:查询收件箱
	 * @author cs
	 * @param condition
	 * @param pageable
	 * @return
	 */
	public Page<ReceiveMessageForm> findAll(ReceiveMessageCondition condition,Pageable pageable);
	
	
	/**
	 * findAddresseeType:查找收件人类型
	 * @author cs
	 * @param pid
	 * @return
	 */
	public List<ReceiveMessageForm> findAddresseeType(String code);
	
	/**
	 * searchAddresseeByType:据收件人类型查找收件人
	 * @author cs
	 * @param condition
	 * @param pageable
	 * @return
	 */
	public Page<ReceiveMessageForm> searchAddresseeByType(ReceiveMessageCondition condition,Pageable pageable);
	

	/**
	 * add:写入信息
	 * @author cs
	 * @param receiveMessageForm
	 */
	public void add(ReceiveMessageForm receiveMessageForm);
	
	/**
	 * backMessage:回信
	 * @author cs
	 * @param receiveMessageId
	 * @param UserName
	 * @param reContent
	 */
	public void backMessage(String receiveMessageId,String UserName,String reContent);
	
	/**
	 * delete:删除
	 * @author cs
	 */
	public void delete(String id);
	
	/**
	 * 通过ID查找
	 * @author cs
	 * @param id
	 * @return
	 */
	public ReceiveMessage findById(String id);

	/**
	 * 根据用户查询未读邮件数
	 * @param UserId
	 * @return
	 */
	public Integer findCountById(String userId );
}
 